home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / css.vim < prev    next >
Encoding:
Text File  |  2001-09-12  |  7.1 KB  |  157 lines

  1. " Vim syntax file
  2. " Language:    Cascading Style Sheets
  3. " Maintainer:    Claudio Fleiner <claudio@fleiner.com>
  4. " URL:        http://www.fleiner.com/vim/syntax/css.vim
  5. " Last Change:    2001 Sept 11
  6. " CSS2 by Nikolai Weibull
  7.  
  8. " For version 5.x: Clear all syntax items
  9. " For version 6.x: Quit when a syntax file was already loaded
  10. if !exists("main_syntax")
  11.   if version < 600
  12.     syntax clear
  13.   elseif exists("b:current_syntax")
  14.   finish
  15. endif
  16.   let main_syntax = 'css'
  17. endif
  18.  
  19. syn case ignore
  20.  
  21.  
  22. syn keyword cssTagName address applet area a base basefont
  23. syn keyword cssTagName big blockquote body br b caption center
  24. syn keyword cssTagName cite code dd dfn dir div dl dt em font
  25. syn keyword cssTagName form h1 h2 h3 h4 h5 h6 head hr html img
  26. syn keyword cssTagName input isindex i kbd link li link map menu
  27. syn keyword cssTagName meta ol option param pre p samp
  28. syn keyword cssTagName select small span strike strong style sub sup
  29. syn keyword cssTagName table td textarea th title tr tt ul u var
  30.  
  31. syn match cssIdentifier "#[a-zA-Z][a-zA-Z0-9-]*"
  32.  
  33. syn match cssLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)\="
  34. syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
  35. syn match cssColor contained "white"
  36. syn match cssColor contained "\(#[0-9A-Fa-f]\{3\}\>\|#[0-9A-Fa-f]\{6\}\>\|rgb\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)\)"
  37. syn match cssURL contained "\<url\s*([^)]*)"ms=s+4,me=e-1
  38.  
  39. syn match cssImportant contained "!\s*important\>"
  40.  
  41. syn match cssFontProperties contained "\<font\>\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\)\="
  42. syn keyword cssFontProperties contained xyz
  43. syn keyword cssFontAttr contained cursive fantasy monospace normal italic oblique
  44. syn keyword cssFontAttr contained bold bolder lighter medium larger smaller
  45. syn match cssFontAttr contained "\<\(sans\>-\)\=\<serif\>"
  46. syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(\<small\>\|\<large\>\)\>"
  47. syn match cssFontAttr contained "\<small-caps\>"
  48.  
  49. syn match cssColorProperties contained "\<color\>"
  50. syn match cssColorProperties contained "\<background\>\(-\(color\|image\|repeat\|attachment\|position\)\>\)\="
  51. syn keyword cssColorAttr contained none top center bottom left right scroll fixed
  52. syn match cssColorAttr contained "\<\(repeat\|repeat-x\|repeat-y\|no-repeat\)\>"
  53.  
  54. syn match cssTextProperties contained "\<\(word-spacing\|letter-spacing\|text-decoration\|vertical-align\|text-transform\|text-align\|text-indent\|text-transform\|text-shadow\|unicode-bidi\|line-height\)\>"
  55. syn keyword cssTextAttr contained normal none underline overline blink sub super middle
  56. syn keyword cssTextAttr contained capitalize uppercase lowercase none left right center justify
  57. syn match cssTextAttr contained "\<line-through\>"
  58. syn match cssTextAttr contained "\<\(text-\)\=\<\(top\|bottom\)\>"
  59.  
  60. syn match cssBoxProperties contained "\<margin\>\(-\(top\|right\|bottom\|left\)\>\)\="
  61. syn match cssBoxProperties contained "\<padding\>\(-\(top\|right\|bottom\|left\)\>\)\="
  62. syn match cssBoxProperties contained "\<border\>\(-\(top\|right\|bottom\|left\)\>\)\=\(-width\|-style\>\)\="
  63. syn match cssBoxProperties contained "\<border-color\>"
  64. syn match cssBoxProperties contained "\<border-style\>"
  65. syn keyword cssBoxProperties contained width height float clear
  66. syn keyword cssBoxAttr contained auto thin medium thick left right none both
  67. syn keyword cssBoxAttr contained none dotted dashed solid double groove ridge inset outset
  68.  
  69. syn keyword cssClassificationProperties contained display
  70. syn match cssClassificationProperties contained "\<white-space\>"
  71. syn match cssClassificationProperties contained "\<list-\(item\|style\(-\(type\|image\|position\)\)\=\)\>"
  72. syn keyword cssClassificationAttr contained block inline none normal pre nowrap
  73. syn keyword cssClassificationAttr contained disc circle square decimal none
  74. syn match cssClassificationAttr contained "\<list-item\>"
  75. syn match cssClassificationAttr contained "\<\(lower\|upper\)-\(roman\|alpha\)\>"
  76.  
  77. syn match cssBoxProperties contained "\<\(min\|max\)-\(width\|height\)\>"
  78. syn match cssBoxProperties contained "\<outline\>\(-\(color\|style\|width\)\>\)\="
  79. syn match cssBoxProperties contained "\<border-collapse\|caption-side\>"
  80. syn match cssClassificationProperties contained "\<counter\>\(-\(increment\|reset\)\>\)\="
  81. syn match cssClassificationProperties contained "\<marker-offset\>"
  82. syn keyword cssClassificationProperties contained cursor direction marks quotes
  83. syn match cssAuralProperties contained "\<pitch-\(range\|during\)\>"
  84. syn match cssAuralProperties contained "\(cue\|pause\)-\(after\|-before\)\>"
  85. syn match cssAuralProperties contained "\<speak\>\(-\(header\|numeral\|punctuation\)\>\)\="
  86. syn match cssAuralProperties contained "\<speed-rate\|play-during\|voice-family\>"
  87. syn keyword cssAuralProperties contained stress azimuth elevation pitch richness volume
  88. syn match cssRenderProperties contained "\<page\>\(-\(break\|after\|inside\)\>\)\="
  89. syn match cssRenderProperties contained "\<empty-cells\|z-index\|table-layout\>"
  90. syn keyword cssRenderProperties contained clip content orphans overflow visibility
  91.  
  92. syn region cssInclude start="@import" start="@include" end=";" contains=cssComment,cssURL
  93. syn match cssBraces contained "[{}]"
  94. syn match cssError contained "{@<>"
  95. syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Properties,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString
  96.  
  97. syn match cssPseudoClass transparent ":\S*" contains=cssPseudoClassId
  98. syn keyword cssPseudoClassId contained link visited active hover
  99. syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
  100.  
  101. syn region cssComment start="/\*" end="\*/"
  102.  
  103. syn region cssString start=+"+ skip=+\\\\\|\\"+ end=+"+
  104. syn region cssString start=+'+ skip=+\\\\\|\\'+ end=+'+
  105.  
  106. if main_syntax == "css"
  107.   syn sync minlines=10
  108. endif
  109.  
  110. " Define the default highlighting.
  111. " For version 5.7 and earlier: only when not done already
  112. " For version 5.8 and later: only when an item doesn't have highlighting yet
  113. if version >= 508 || !exists("did_css_syn_inits")
  114.   if version < 508
  115.     let did_css_syn_inits = 1
  116.     command -nargs=+ HiLink hi link <args>
  117.   else
  118.     command -nargs=+ HiLink hi def link <args>
  119.   endif
  120.  
  121.   HiLink cssComment Comment
  122.   HiLink cssTagName Statement
  123.   HiLink cssFontProperties StorageClass
  124.   HiLink cssColorProperties StorageClass
  125.   HiLink cssTextProperties StorageClass
  126.   HiLink cssBoxProperties StorageClass
  127.   HiLink cssClassificationProperties StorageClass
  128.   HiLink cssAuralProperties StorageClass
  129.   HiLink cssRenderProperties StorageClass
  130.   HiLink cssFontAttr Type
  131.   HiLink cssColorAttr Type
  132.   HiLink cssTextAttr Type
  133.   HiLink cssBoxAttr Type
  134.   HiLink cssClassificationAttr Type
  135.   HiLink cssPseudoClassId PreProc
  136.   HiLink cssLength Number
  137.   HiLink cssColor Constant
  138.   HiLink cssURL String
  139.   HiLink cssIdentifier Function
  140.   HiLink cssInclude Include
  141.   HiLink cssImportant Special
  142.   HiLink cssBraces Function
  143.   HiLink cssError Error
  144.   HiLink cssInclude Include
  145.   HiLink cssString String
  146.   delcommand HiLink
  147. endif
  148.  
  149. let b:current_syntax = "css"
  150.  
  151. if main_syntax == 'css'
  152.   unlet main_syntax
  153. endif
  154.  
  155. " vim: ts=8
  156.  
  157.